#include <iostream>

using namespace std;

class complex
{
public:
	complex(double r = 0.0, double i = 0.0)
	{
		real = r;
		imag = i;
	}

	complex operator + (complex c2);
	complex operator - (complex c2);

	void display();

	void output()
	{
		cout << real << endl;
		cout << imag << endl;
	}

private:
	double real;
	double imag;
};

complex complex::operator + (complex c2)
{
	return complex(real + c2.real, imag + c2.imag);
}

complex complex::operator - (complex c2)
{
	return complex(real - c2.real, imag - c2.imag);
}

void complex::display()
{
	cout << "(" << real << " , " << imag << " ) " << endl;
}

void main()
{
	complex com(10, 20), bom(5, 8), cpe;
	com.output();
	bom.output();

	cout << " com = "; 
	com.display();

	cout << " bom = ";
	bom.display();

	cpe = com - bom;
	cout << "cpe = com - bom = ";
	cpe.display();
}